<!DOCTYPE html>
<html>

<head>

    {include file="common:meta"}

</head>
<style>
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">

                <div class="ibox-content">
                    <form method="" class="form-horizontal" id="form" action="">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success" style="text-align: center; font-size: 20px;">
                            添加预审流水厅
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <label class="col-sm-2 control-label">*房间ID
                            </label>
                            <div class="col-sm-10">
                                <input type="number" name="r_id" value="" class="form-control" id="number-day">
                            </div>
                        </div>

                        <div class="col-sm-10">
                            <input type="hidden" name="userId"  value="{$userId}" class="form-control">
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group has-success">
                            <div class="col-sm-4 col-sm-offset-2">
                                <input class="btn btn-primary" id="btn-submit" type="button" value="提交">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="common:footer"}
<script>

    //同意修改
    var index = parent.layer.getFrameIndex(window.name);
    $('#btn-submit').click(function(){

        if($("#number-day").val()==''){
            layer.msg('请选择！',{
                time:1500
            });
            return false;
        }

        layer.confirm('确定创建预审家族吗？',{
            title:['提示','font-size:18px;font-family:楷体;font-weight:700;'],
            btn: ['确定','取消'] //按钮
        },function(){
            $.ajax({
                type:'get',
                url:'/UserBuildAgreeFamilyInfo',
                async:true,
                data:$('#form').serialize(),
                dataType:'json',
                success:function(result){
                    if(result.code == 100){
                        //   parent.layer.close(index);//关闭当前页
                        layer.msg(result.msg,{
                            icon:1,
                            time:1000
                        });
                        //$('#tb_departments',parent.window.document).reload();
                        setTimeout(function () {
                            parent.layer.close(index);// 关闭layer
                        },1500);
                        //  window.parent.location.reload();
                        //window.parent.parent.location.replace(location.href);
                        //$('#tb_departments',parent.window.document).bootstrapTable(('refresh'));

                        // window.parent.location.replace(location.href)//刷新父级页面
//                        $('#tb_departments').bootstrapTable(('refresh'));
//                        $('#batch-deal-with').css('display','none');
                    }
                    else{
                        layer.msg(result.msg,{
                            icon:2,
                            time:1000
                        });
                    }
                },
                error:function(err){
                    layer.msg('服务器开小差了！',{
                        time:1500
                    });
                }
            });
        });
    });
</script>
</body>

</html>